import { Field, Int, ObjectType } from "@nestjs/graphql";
import { UserOnTask } from "@prisma/client";
import { UserEntity } from "../user.entity/user.entity";
import { TaskEntity } from "../task.entity/task.entity";
import { UserTaskItemEntity } from "../user.task.item.entity/user.task.item.entity";
import { TeacherEntity } from "../teacher.entity/teacher.entity";

@ObjectType()
export class UserOnTaskEntity implements UserOnTask {
    @Field(() => UserEntity, { nullable: true })
    user: UserEntity

    @Field(() => Int)
    userId: number

    @Field(() => TaskEntity, { nullable: true })
    task: TaskEntity

    @Field(() => Int)
    taskId: number;

    @Field(() => [UserTaskItemEntity], { nullable: true })
    items: UserTaskItemEntity[]

    @Field({ nullable: true })
    common: string

    @Field(() => Int)
    teacherId: number;

    @Field(() => Int)
    incId: number

    @Field(() => TeacherEntity, { nullable: true })
    teacher?: TeacherEntity
}
